﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>
        学生信息管理平台
    </title>
    <link href="../../Style/StudentStyle.css" rel="stylesheet" type="text/css"/>
    <link href="../../Script/jBox/Skins/Blue/jbox.css" rel="stylesheet" type="text/css"/>
    <link href="../../Style/ks.css" rel="stylesheet" type="text/css"/>
    <link href="../../css/mine.css" type="text/css" rel="stylesheet">
    <script src="../../Script/jBox/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="../../Script/jBox/jquery.jBox-2.3.min.js" type="text/javascript"></script>
    <script src="../../Script/jBox/i18n/jquery.jBox-zh-CN.js" type="text/javascript"></script>
    <script src="../../Script/Common.js" type="text/javascript"></script>
    <script src="../../Script/Data.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            //ajax动态获取用户名、学号、身份证id
            $("#stuNo").blur(function () {
                var stuNo = $(this).val();
                $.post("ajax", {"stuno": stuNo, "method": "getByStuNo"}, function (rs) {
                    //编写回调函数
                    rs = eval("(" + rs + ")");
                    if (rs != null) {
                        $("#stuNoMsg").html("学号已存在").css("color", "red");
                    } else {
                        $("#stuNoMsg").html("学号可用").css("color", "green");
                    }
                });
            });
            $("#stuName").blur(function () {
                var stuName = $(this).val();
                $.post("ajax", {"stuname": stuName, "method": "getByStuName"}, function (rs) {
                    //编写回调函数
                    rs = eval("(" + rs + ")");
                    if (rs != null) {
                        $("#stuNameMsg").html("姓名已存在").css("color", "red");
                    } else {
                        $("#stuNameMsg").html("姓名可用").css("color", "green");
                    }
                });
            });
            $("#stuIdnumber").blur(function () {
                var stuIdnumber = $(this).val();
                var length = stuIdnumber.length;
                if (length > 18) {
                    $("#stuIdnumberMsg").html("身份证号码位数不正确").css("color", "red");
                    return;
                } else {
                    $.post("ajax", {"stuidnumber": stuIdnumber, "method": "getByStuIdNumber"}, function (rs) {
                        //编写回调函数
                        rs = eval("(" + rs + ")");
                        if (rs != null) {
                            $("#stuIdnumberMsg").html("身份证号已存在").css("color", "red");
                        } else {
                            $("#stuIdnumberMsg").html("身份证号可用").css("color", "green");
                        }
                    });
                }
            });
        });
    </script>
</head>
<body>

<div class="div_head">
            <span>
                <span style="float:left">当前位置是：教务中心-》学生管理-》新增</span>
                <span style="float:right;margin-right: 8px;font-weight: bold"></span>
            </span>
</div>
</div>
<div class="cztable">
    <form action="${pageContext.request.contextPath}/Educational/student/studentServlet?method=addStudent"
          method="post">
        <table border="1" width="100%" class="table_a">
            <tr width="120px;">
                <td width="10%">学号：<span style="color:red">*</span>：</td>
                <td>
                    <input id="stuNo" type="text" name="stuNo" value=""/><span id="stuNoMsg"></span>
                </td>
            </tr>

            <tr width="120px;">
                <td>姓名<span style="color:red">*</span>：</td>
                <td>
                    <input id="stuName" type="text" name="stuName" value="杨XX"/><span id="stuNameMsg"></span>
                </td>
            </tr>

            <tr>
                <td>班级<span style="color:red">*</span>：</td>
                <td>
                    <select name="gid">
                        <%--动态获取--%>
                        <c:forEach items="${requestScope.grades}" var="grade">
                            <option value="${grade.gradecard}">${grade.gradename}</option>
                        </c:forEach>
                    </select>
                </td>
            </tr>
            <tr>
                <td>性别<span style="color:red">*</span>：</td>
                <td>
                    <input type="radio" name="stuSex" checked value="1"/>男 <input type="radio" name="stuSex" value="0"/>女
                </td>
            </tr>
            <tr>
                <td>EMAIL：</td>
                <td>
                    <input type="text" name="stuEmail" value="1332@126.com"/>
                </td>
            </tr>

            <tr>
                <td>联系电话：</td>
                <td>
                    <input type="text" name="stuPhone" value="13333333333"/>
                </td>
            </tr>

            <tr>
                <td>户口所在地：</td>
                <td>
                    <input type="text" name="stuRegistered" value="北京"/>
                </td>
            </tr>

            <tr>
                <td>住址：</td>
                <td>
                    <input type="text" name="stuAddress" value="朝阳"/>
                </td>
            </tr>
            <tr>
                <td>政治面貌：</td>
                <td>
                    <input type="text" name="stuProfession" value="党员"/>
                </td>
            </tr>
            <tr>
                <td>身份证号：</td>
                <td>
                    <input id="stuIdnumber" type="text" name="stuIdnumber" value="110111111111111111111"/><span
                        id="stuIdnumberMsg"></span>
                </td>
            </tr>

            <tr>
                <td>专业：</td>
                <td>
                    <input type="text" name="stuPolitice" value="java"/>
                </td>
            </tr>


            <tr>
                <td>简介<span style="color:red">*</span>：</td>
                <td>
                    <textarea name="stuIntroduction">一个新开辟领域的探讨，探讨摸索</textarea>
                </td>
            </tr>
            <tr>
                <td colspan=2 align="center">
                    <input type="submit" value="添加"/>
                </td>
            </tr>
        </table>
    </form>
</div>
</div>
</div>
</div>
</body>
</html>
